package com.mfp.java.testYou.db.model;

import java.io.Serializable;
import java.util.List;

public class User extends Entity implements Serializable {

	private static final long serialVersionUID = -2397551280202136072L;

	private String userName, lang;
    private String password;
    private int id;
	private UserRole role;
	private List<CompletedTest> completedTests;
	
	public final String getUserName() {
		return userName;
	}

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public final void setUserName(String userName) {
		this.userName = userName;
	}

    public final int getId(){
        return id;
    }

    public final void setId(int id){
        this.id = id;
    }
	public final UserRole getRole() {
		return role;
	}

	public final void setRole(UserRole role) {
		this.role = role;
	}

	public final String getLang() {
		return lang;
	}

	public final void setLang(String lang) {
		this.lang = lang;
	}

	public static final User getJaneDo() {
		User u = new User();
		u.setUserName("JaneDo");
		u.setRole(UserRole.ADMIN);
		u.setLang("en");
		return u;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(userName);
		sb.append(" - ");
		sb.append(lang);
		sb.append(" - ");
		sb.append(role);
		return sb.toString();
	}

	public List<CompletedTest> getTakenTests() {
		return completedTests;
	}

	public void setCompletedTests(List<CompletedTest> takenTests) {
		this.completedTests = takenTests;
	}
}
